CC     = icc
CFLAGS = -Wall -O3

INC_PATH = ./inc
BIN_PATH = ./bin
SRC_PATH = ./src

SRCS = ./src/randomlib.c ./src/splines.c ./src/fminbr.c ./src/step_down_new.c
GEN  = ./src/gen2d.c
EXE  = $(BIN_PATH)/step_down_new
OBJS  = $(SRCS:.c=.o)

#Explicit Rule
$(EXE): $(OBJS)
	$(CC) $^ -I$(INC_PATH) -o $@
	rm -rf $(OBJS)

#Pattern Rule
%.o: %.c
	$(CC) -c $^ $(CFLAGS) -I$(INC_PATH) -o $@

clean: 
	rm -f *.o